<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1">
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <meta http-equiv="content-language" content="th" />
        <meta name="robots" content="index, follow" />
        <meta name="revisit-after" content="3 days" />
        <title><?php echo $title ?></title>
        <link rel="icon" type="image/png" href="<?php echo base_url() ?>img/favicon.png">
        <?php
        if (isset($og)) {
            ?>
            <meta property="og:title" content="<?php echo $og['title'] ?>" />
            <meta property="og:url" content="<?php echo $og['url'] ?>" />
            <meta property="og:image" content="<?php echo $og['image'] ?>" />
            <?php
        } else {
            ?>
            <meta property="og:image" content="<?php echo ASSET_URI ?>img/logo_square.png" />
            <?php
        }
        ?>
        <?php
        // Add Preset CSS //
        $this->carabiner->css('bootstrap.min.css');
        $this->carabiner->css('glyphicons.css');
        $this->carabiner->css('font-awesome.min.css');
        $this->carabiner->css('font-awesome-ie7.min.css');

        $this->carabiner->css('style.css');
        if (isset($css)) {
            foreach ($css as $row) {
                $this->carabiner->css($row);
            }
        }
        $this->carabiner->display('css');

        // Add Preset JS //
        $this->carabiner->js('jquery.js');
        $this->carabiner->js('bootstrap.min.js');
        $this->carabiner->js('jquery.masonry.min.js');


        if (isset($js)) {
            foreach ($js as $row) {
                $this->carabiner->js($row);
            }
        }
        $this->carabiner->display('js');

        if (isset($js_indy)) {
            foreach ($js_indy as $row) {
                echo '<script src="' . base_url() . 'js/' . $row . '"></script>';
            }
        }
        if (isset($css_indy)) {
            foreach ($css_indy as $row) {
                echo '<link type="text/css" rel="stylesheet" href="' . base_url() . 'css/' . $row . '"></script>';
            }
        }
        ?>


    </head>
    <body>

        <div class="container" <?php echo $is_mobile?'style="width:465px;padding:5px;"':''?>>
            
               
            
            <?php echo $main_nav ?>
            <?php echo $content ?>
            
            
            <div class="footer">
                <hr/>
                สงวนลิขสิทธิ์ปี <?php echo date('Y') ?>  Shopsii.com <?php echo $is_mobile?'<br/>':''?>
                 ติดต่อสอบถามได้ที่ <a href="mailto:<?php echo ADMIN_EMAIL ?>"><?php echo ADMIN_EMAIL ?></a> หรือทาง <a href="http://www.facebook.com/pages/Shopsii/334172216705805" target="_blank">Shopsii Fanpage</a>
            </div>
            <?php echo $is_mobile?'<br/>':'<div class="bottom-space"></div>'?>
            
        </div>

        <div id="fb-root"></div>
        <script>
            /*Do Prune*/
<?php
if (mt_rand(1, 10) == 1) {
    ?>
                $(function() {
                    setTimeout(function() {
                        $.post('<?php echo base_url() ?>ajax/do_prune_tmp_cover');
                    }, 3000);

                });
    <?php
}
if (mt_rand(1, 15) == 2) {
    ?>
                $(function() {
                    setTimeout(function() {
                        $.post('<?php echo base_url() ?>ajax/do_sum_score');
                    }, 3000);
                });
    <?php
}
?>
            (function(d, s, id) {
                var js, fjs = d.getElementsByTagName(s)[0];
                if (d.getElementById(id))
                    return;
                js = d.createElement(s);
                js.id = id;
                js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=367475326690221";
                fjs.parentNode.insertBefore(js, fjs);
            }(document, 'script', 'facebook-jssdk'));
        </script>
        <script>
            (function(i, s, o, g, r, a, m) {
                i['GoogleAnalyticsObject'] = r;
                i[r] = i[r] || function() {
                    (i[r].q = i[r].q || []).push(arguments)
                }, i[r].l = 1 * new Date();
                a = s.createElement(o),
                        m = s.getElementsByTagName(o)[0];
                a.async = 1;
                a.src = g;
                m.parentNode.insertBefore(a, m)
            })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');

            ga('create', 'UA-40396443-1', 'shopsii.com');
            ga('send', 'pageview');
            
           
        </script>
    </body>
</html>